﻿using System;
using System.Collections.Generic;
using System.Linq;
using MyAMS.WebServer.Models;

namespace MyAMS.WebServer.Repositories
{
    class UserRepository : IUserRepository
    {
        public IQueryable<User> Get()
        {
            User u1 = new User
            {
                ID = Guid.NewGuid(),
                Name = "test",
                DisplayName = "张三",
                Email = "123@abc.com",
                Password = "123456"
            };

            User u2 = new User
            {
                ID = Guid.NewGuid(),
                Name = "test2",
                DisplayName = "李四",
                Email = "123@abc.com",
                Password = "123456"
            };

            User u3 = new User
            {
                ID = Guid.NewGuid(),
                Name = "test3",
                DisplayName = "王五",
                Email = "123@abc.com",
                Password = "123456"
            };

            List<User> mockList = new List<User>();
            mockList.Add(u1);
            mockList.Add(u2);
            mockList.Add(u3);
            return mockList.AsQueryable();
        }

        public User Get(Guid id)
        {
            return new User
            {
                ID = id,
                Name = "test",
                DisplayName = "张三",
                Email = "123@abc.com",
                Password = "123456"
            };
        }

        #region IUserRepository Members

        public User GetUser(string name)
        {
            return new User
            {
                ID = Guid.NewGuid(),
                Name = name,
                DisplayName = name,
                Email = "123@abc.com",
                Password = "123456"
            };
        }

        #endregion
    }
}
